import { View } from '@tarojs/components';

import './index.scss';

interface DescriptionTitleProps {
  title: string;
  description: string;
}

const PREFIX_CLS = 'm-description-title';

function DescriptionTitle({ title, description }: DescriptionTitleProps) {
  return (
    <View className={PREFIX_CLS}>
      <View className={`${PREFIX_CLS}-title`}>{title}</View>
      <View className={`${PREFIX_CLS}-description`}>
        {description ? `(${description})` : null}
      </View>
    </View>
  );
}

export default DescriptionTitle;
